﻿using CPPEI.Coolzon.Common;
using CPPEI.Coolzon.Event.NCL;
using CPPEI.Coolzon.Service.Contract;
using Sunboxsoft.ChanceData.ServiceProxy.MainServiceRef;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CPPEI.Coolzon.UI.Views.EventProxies
{
    public class RespGetSolutionListHandler : BaseResponseHandler<Service.Contract.RespGetSolutionListData>
    {
        protected override void OnHandle(RemoteEventProxy remoteEventProxy, Response response, RespGetSolutionListData responseData)
        {
            NCLGetSolutionListEvent @event = new NCLGetSolutionListEvent();
            @event.State = NCLEventState.Finished;
            @event.Result = new NCLGetSolutionListEvent.EventResult();
            @event.Result.SolutionList = new List<SolutionItem>();
            @event.Result.SolutionList.AddRange(responseData.Solutions);

            NCLEventBus.PublishAsync(@event);
        }
    }
}
